#include <iostream>
#include <cmath>

using namespace std;

int n;

int main(){
	cin >> n;
    int i;
	for(i = n; i >= 0; i--){
		int k;
        cin >> k;
		if(k){
			if(i != n && k > 0) cout<<"+";
			if(k < 0) cout << "-"; 
			if(i==0) cout << fabs(k);
			else{
				if(k == 1 || k == -1){ 
					if(i == 1)  cout << "x";
                    else if(k == 1) cout << "x^" << i; 
					else cout << "x^" << i; 
				}
				else{
					if(i != 1) cout << fabs(k) << "x^" << i;
					else cout << fabs(k) << "x"; 
				}
			}
		}
	}
	return 0;
}
